<!doctype html>
<html lang="<?php echo Configure::read('cfg.meta-language');?>" class="no-js">
<head>
	<meta charset="<?php echo Configure::read('cfg.codepage');?>">
	<title><?php echo (isset($title_for_layout) && !empty($title_for_layout)) ? $title_for_layout : Configure::read('cfg.homepage_title'); ?></title>
	<?php
		echo $this->Html->meta('keywords',(isset($keywords))?$keywords:Configure::read('cfg.homepage_keywords'));
		echo $this->Html->meta('description',(isset($description))?$description:Configure::read('cfg.homepage_description'));
	
		echo $this->Html->meta('favicon.ico','/favicon.ico', array('type' => 'icon')
);

		echo $this->Html->css(array(
			'style.css',
			'fullcalendar.css',
			'highslide/highslide.css'
		));
	
		 echo $this->Html->script(array(
			    '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js',
				'//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js',
                'superfish.js',
                'hoverIntent.js',
				'modernizr.custom.77386.js',
				'highslide-full.js',
				'highslide.install.js',
				'whcookies.js'
		 ));
		
		if($this->layout == 'panel') echo $this->Html->css(array('cake.generic'),null,array('inline'=>true));
		if(Configure::read('cfg.debuging') >= 1){
			echo $this->Html->css(array('cake.debuging'),null,array('inline'=>true));
		}
		
		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
	<?php
		$analytics = Configure::read('cfg.GoogleAnalyticsScript');
		if(!empty($analytics) && $analytics != 'null') echo $analytics;
	?>
	<script>
		$(document).ready(function(){
			$('#calendar').fullCalendar({
                eventSources: [{
                   url: '/articles/events', // use the `url` property
                   color: 'yellow',    // an option!
                   textColor: 'black'  // an option!
                }]              
            });
		});
	</script>
</head>
<body>
	<?php
		echo $this->Session->flash();
		echo $this->Session->flash('auth');
		echo $this->Session->flash('email');
	?>
	
	<?php echo $this->fetch('content'); ?>
	
	<?php
		$dump = $this->element('sql_dump');
		if(!empty($dump)){
			echo $dump;
		}
	?>
	
	<?php echo $scripts_for_layout; ?>
	<script>
		(function($){
			jQuery('.more_elements').superfish({
				animation: {height:'show'},
				delay: 1200
			});
			
			$('.galeria').click(function(){
				return hs.expand(this);
			});
		})(jQuery);
	</script>
	<?php echo $this->Html->script(array('fullcalendar.js')); ?>
	<?php if (class_exists('JsHelper') && method_exists($this->Js, 'writeBuffer')) echo $this->Js->writeBuffer(); ?>
</body>
</html>